import { StepEngine } from "../consts/stepEngine"

// 判断step执行结果pass的前提下，执行结果是否有效，主要是指断言类型
export const getIfStepResultValid = (code, result) => {
    const stepEngine = StepEngine[code]
    const getIfResultValid = typeof stepEngine.getIfResultValid === 'function' ? stepEngine.getIfResultValid : () => true

    return getIfResultValid(result)
}